﻿<div>
    <Cascader Options="@disabledNodes"></Cascader>
</div>

@code {
    List<CascaderNode> disabledNodes = GetDisabledNodes();

    private static List<CascaderNode> GetDisabledNodes()
    {
        List<CascaderNode> list = new List<CascaderNode>() {
        new CascaderNode()
        {
            Value = "1",
            Label = "湖北",
            Children = new CascaderNode[] {
                    new CascaderNode{ Value = "11", Label="武汉", Children = new CascaderNode[]{
                        new CascaderNode{ Value = "111", Label="武昌区", Children = new CascaderNode[]{
                            new CascaderNode{ Value = "1111", Label="黄鹤楼街道"},
                            new CascaderNode{ Value = "1112", Label="白沙洲街道", Disabled = true}
                        } },
                        new CascaderNode{ Value = "112", Label="洪山区"}
                    } },
                    new CascaderNode{ Value = "12", Label="黄石", Disabled = true},
                    new CascaderNode{ Value = "13", Label="宜昌"}
                }
        }, new CascaderNode()
        {
            Value = "2",
            Label = "浙江",
            Children = new CascaderNode[] {
                    new CascaderNode{ Value = "21", Label="杭州"},
                    new CascaderNode{ Value = "22", Label="温州"},
                    new CascaderNode{ Value = "23", Label="义乌", Disabled = true },
                    new CascaderNode{ Value = "23", Label="宁波"}
                }
        }, new CascaderNode()
        {
            Value = "3",
            Label = "上海",
            Disabled = true,
            Children = new CascaderNode[] {
                    new CascaderNode{ Value = "31", Label="徐汇区"},
                    new CascaderNode{ Value = "32", Label="黄浦区"},
                    new CascaderNode{ Value = "32", Label="浦东新区"},
                    new CascaderNode{ Value = "32", Label="崇明区", Disabled = true }
                }
        }, new CascaderNode()
        {
            Value = "4",
            Label = "北京",
            Children = new CascaderNode[] {
                    new CascaderNode{ Value = "41", Label="朝阳", Disabled = true },
                    new CascaderNode{ Value = "42", Label="东城"},
                    new CascaderNode{ Value = "43", Label="西城"}
                }
        }, new CascaderNode()
        {
            Value = "5",
            Label = "江苏",
            Children = new CascaderNode[] {
                    new CascaderNode{ Value = "51", Label="南京", Disabled = true, Children = new CascaderNode[]{
                        new CascaderNode{ Value = "511", Label="鼓楼区"},
                        new CascaderNode{ Value = "512", Label="玄武区"}
                    } },
                    new CascaderNode{ Value = "52", Label="苏州"},
                    new CascaderNode{ Value = "53", Label="无锡"},
                    new CascaderNode{ Value = "53", Label="扬州"}
                }
        }};
        return list;
    }
}
